home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / unix / tracker_4_3.lzh / tracker / song.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  3.1 KB  |  146 lines

  1. /* song.h 
  2.     vi:se ts=3 sw=3:
  3.  */
  4.  
  5. /* internal data structures for the soundtracker player routine....
  6.  */
  7.  
  8. /* $Id: song.h,v 4.0 1994/01/11 17:55:59 espie Exp espie $
  9.  * $Log: song.h,v $
  10.  * Revision 4.0  1994/01/11  17:55:59  espie
  11.  * REAL_MAX_PITCH for better player.
  12.  *
  13.  * Revision 1.3  1994/01/05  14:54:09  Espie
  14.  * *** empty log message ***
  15.  *
  16.  * Revision 1.2  1993/12/28  13:54:44  Espie
  17.  * REAL_MAX_PITCH != MAX_PITCH.
  18.  *
  19.  * Revision 1.1  1993/12/26  00:55:53  Espie
  20.  * Initial revision
  21.  *
  22.  * Revision 3.5  1993/12/02  15:45:33  espie
  23.  * Added samples_start.
  24.  *
  25.  * Revision 3.4  1993/11/17  15:31:16  espie
  26.  * *** empty log message ***
  27.  *
  28.  * Revision 3.1  1992/11/19  20:44:47  espie
  29.  * Protracker commands.
  30.  *
  31.  * Revision 3.0  1992/11/18  16:08:05  espie
  32.  * New release.
  33.  *
  34.  * Revision 2.5  1992/10/31  11:18:00  espie
  35.  * New fields for optimized resampling.
  36.  * Exchanged __ANSI__ to SIGNED #define.
  37.  */
  38.  
  39. #ifdef SIGNED
  40. typedef signed char SAMPLE;
  41. #else
  42. typedef char SAMPLE;
  43. #endif
  44.  
  45. #define NUMBER_SAMPLES 32
  46.  
  47. #define BLOCK_LENGTH 64
  48. #define NUMBER_TRACKS 4
  49. #define NUMBER_PATTERNS 128
  50.  
  51. #define NUMBER_EFFECTS 40
  52.  
  53. /* some effects names */
  54. #define EFF_ARPEGGIO    0
  55. #define EFF_DOWN        1
  56. #define EFF_UP          2
  57. #define EFF_PORTA       3
  58. #define EFF_VIBRATO     4
  59. #define EFF_PORTASLIDE  5
  60. #define EFF_VIBSLIDE    6
  61. #define EFF_OFFSET      9
  62. #define EFF_VOLSLIDE    10
  63. #define EFF_FF          11
  64. #define EFF_VOLUME      12
  65. #define EFF_SKIP        13
  66. #define EFF_EXTENDED    14
  67. #define EFF_SPEED       15
  68. #define EFF_NONE        16
  69. #define EXT_BASE        16
  70. #define EFF_SMOOTH_UP   (EXT_BASE + 1)
  71. #define EFF_SMOOTH_DOWN (EXT_BASE + 2)
  72. #define EFF_CHG_FTUNE   (EXT_BASE + 5)
  73. #define EFF_LOOP        (EXT_BASE + 6)
  74. #define EFF_RETRIG      (EXT_BASE + 9)
  75. #define EFF_S_UPVOL     (EXT_BASE + 10)
  76. #define EFF_S_DOWNVOL   (EXT_BASE + 11)
  77. #define EFF_NOTECUT     (EXT_BASE + 12)
  78. #define EFF_LATESTART   (EXT_BASE + 13)
  79. #define EFF_DELAY       (EXT_BASE + 14)
  80.  
  81. #define SAMPLENAME_MAXLENGTH 22
  82. #define TITLE_MAXLENGTH 20
  83.  
  84. #define MIN_PITCH 113
  85. #define MAX_PITCH 856
  86. #define REAL_MAX_PITCH 1050
  87.  
  88. #define MIN_VOLUME 0
  89. #define MAX_VOLUME 64
  90.  
  91. /* the fuzz in note pitch */
  92. #define FUZZ 2
  93.  
  94. /* we refuse to allocate more than 500000 bytes for one sample */
  95. #define MAX_SAMPLE_LENGTH 500000
  96.  
  97. struct sample_info
  98.    {
  99.    char *name;
  100.    int  length, rp_offset, rp_length;
  101.    unsigned long  fix_length, fix_rp_length;
  102.    int volume;
  103.    int finetune;
  104.    SAMPLE *start, *rp_start;
  105.    };
  106.  
  107. /* the actual parameters may be split in two halves occasionnally */
  108.  
  109. #define LOW(para) ((para) & 15)
  110. #define HI(para) ((para) >> 4)
  111.  
  112. struct event
  113.    {
  114.    unsigned char sample_number;
  115.    unsigned char effect;
  116.    unsigned char parameters;
  117.    unsigned char note;
  118.    int pitch;
  119.    };
  120.  
  121. struct block
  122.    {
  123.    struct event e[NUMBER_TRACKS][BLOCK_LENGTH];
  124.    };
  125.     
  126.         
  127. struct song_info
  128.    {
  129.    int length;
  130.    int maxpat;
  131.    int transpose;
  132.    char patnumber[NUMBER_PATTERNS];
  133.    struct block *pblocks;
  134.    };
  135.  
  136. struct song
  137.    {
  138.    char *title;
  139.       /* sample 0 is always a dummy sample */
  140.    struct sample_info samples[NUMBER_SAMPLES];
  141.    struct song_info info;
  142.    long samples_start;
  143.    };
  144.  
  145. #define AMIGA_CLOCKFREQ 3575872
  146.